package com.maisonliberte;

import com.maisonliberte.conf.Config;
import com.maisonliberte.crawller.CrawlerHandler;
import com.maisonliberte.exceptions.CrawlingException;
import com.maisonliberte.updater.UpdaterHandler;
import com.maisonliberte.util.FileUtil;

public class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		
		try{
			for(int i = 0; i < 0; i++){
				System.out.println("상품 name crawling start");
				FileUtil.removeDIR(Config.getInstance().imageSaveLocation);
				FileUtil.removeUploadImage();
				CrawlerHandler handler = new CrawlerHandler();
				//handler.brandCrawling();
				handler.productCrawling();
				System.out.println("상품 name crawling finish");
				
				//Thread.sleep(60000);
				
			}

			
			System.out.println("상품 가격 정보 업데이트 Start");			
			UpdaterHandler update = new UpdaterHandler();
			update.process();
			System.out.println("상품 가격 정보 업데이트 Finish");			
			
			
		}catch(CrawlingException cex){
			System.out.println("[" + cex.getErr() + "]" + cex.getMessage());
		}catch(Exception ex){
			System.out.println(ex.getMessage());
		}

	}

}
